   <%=javascript_include_tag :all-%>

    <%=stylesheet_link_tag "ad landing page.css"-%>

<body>
  <%=render :partial=>"layouts/header" -%>
<div class="container">


     <div class="navigation">
     	<ul class="breadcrumb">
        	<li><a href="">Home</a></li>
            <li><a href="">Student</a></li>
            <li>Find Coaching</li>
    	</ul>
    </div>
	<div class="main-ad">
    	<div class="ad-header">
        	<div class="line-one">
            	<%=@advertisment.title%>
            </div>
            <div class="line-two">
            	<%= @advertisment.location %>
           	</div>
		</div>
        <div class="ad-tabs">
            <ul>
                <li class="selected"><a href="">About</a></li>
                <li>  <%= link_to_remote "Comments",
                            :url => {:controller=>"view_advertisment",:action => "comments",:id => params[:id]},
                            :update => "details"
                      %>
                </li>
                  <%if (@imagescount!=0) -%>
                <li>
                      <%= link_to_remote  "Photos" ,
                                  :url => {:controller=>"view_advertisment",:action => "fullimage",:id => params[:id],:imageid=>@firstimage.id},
                                  :update => "details"
                      %>

                </li>
                <%end -%>
            </ul>
		</div>
        <div class="ad-inner">
        	<div class="details" id="details">

              <div id="ad-image">
                <div  class="ad-image">
                  <%if (@imagescount==0) -%>
                  <a href="">
                  <%=image_tag "noimage.jpg",:width=>"170px",:height=>"115px",:align=>"left", :border=>"0px" -%>
                  </a>
                   <%else %>
                  <%=image_tag @firstimage.filename,:width=>"170px",:height=>"115px",:align=>"left", :border=>"0px" -%>
                  <%end -%>

                </div>
                 <%if (@imagescount!=0) -%>
                <div class="enlarge-button">
                  <%= link_to_remote  image_tag("enlarge-icon.jpg", :border=>"0px", :height=> "15px") ,
                            :url => {:controller=>"view_advertisment",:action => "fullimage",:id => params[:id],:imageid=>@firstimage.id},
                            :update => "details"
                %>
                </div>
                     <%end -%>
                </div>
                	
                <div class="image-icons">
               
              


                     <ul>
 <% @images.each do |image|-%>
              <li>

   

                      <%= link_to_remote image_tag(image.filename, :border=>"0px", :width=> "38px", :height=>"26px"),
                            :url => {:controller=>"view_advertisment",:action => "swapimage",:id => params[:id],:imageid=>image.id},
                            :update => "ad-image"
                      %>

             </li>
<%end -%>
                    </ul>
            	
                </div>
                <div class="comments-button">
                	
                     <%= link_to_remote image_tag("comments-icon.jpg", :border=>"0px"),
                            :url => {:controller=>"view_advertisment",:action => "comments",:id => params[:id]},
                            :update => "details"
                     %>
                   
                </div>
                <div class="separator1">
                	<%=image_tag "line.jpg", :border=>"0px" -%>
                    </div>
                  <div class="ad-middle">
                    <div class="ad-fields">
                <% @advertismentattributes.each do |attribute|-%>
                <% @fields=YAML.load(attribute.field_values)-%>
                       <div class="fields">
                            <%@fields.each do |e| -%>
                            <span style="font-weight:bold"><%=e[0].gsub("_"," ").capitalize -%></span> :  <br>
                            <%end -%>
                       </div>
                        <div class="fields-value">
                            <%@fields.each do |e| -%>
                            <span style="font-weight:normal"><%=e[1] -%></span><br>
                            <%end -%>
                       </div>












                     <%end-%>

                    </div>
                    <div class="separator2">
                        <%=image_tag "line.jpg"  -%>
                    </div>
                    <div class="posted">
                        <div class="posted-fields">
                            Posted on:
                            <br />
                            Posted by:
                        </div>
                        <div class="posted-value">
                           <%= @advertisment.created_at.to_formatted_s(:long_ordinal) %>
                            <br />
                           <% @username.each do |username|%>
                           <%=username.name%>
                           <%end%>
                            <br />
                            Student
                            <br />
                           <%= @university.name %>
                        </div>
                     </div>
                    <div class="view-profile">
                         <a href=""><%=image_tag "view-profile.jpg", :width=>"72px",:height=>"19px",:border=>"0px" -%></a>                    </div>
               </div>
					<div class="description">
                        <div class="description-heading">
                            Description
                        </div>
                    <%= @advertisment.description %>
                    </div>
                  </div>
          	<div class="right-column">
            	<div class="ad-action-buttons">
                    <div class="save-ad">
                    <a href=""><%=image_tag "save-ad.jpg", :border=>"0px" -%>&nbsp;&nbsp;Save Ad</a>
                    </div>
                    <div class="print">
                    <a href=""><%=image_tag "print.jpg", :border=>"0px" -%>&nbsp;&nbsp;Print</a>
                    </div>
                    <div class="email-to-friend">
                    <a href=""><%=image_tag "email-to-friend.jpg", :border=>"0px" -%>&nbsp;&nbsp;E-mail to friend</a>
                    </div>
                    <div class="report-abuse">
                   <a href=""><%=image_tag "report-abuse.jpg", :border=>"0px" -%>&nbsp;&nbsp;Report abuse</a>
                   </div>
                </div>
               	<div class="get-more-info">
            		<%=image_tag "get-more-info.jpg", :border=>"0px" -%>&nbsp;&nbsp;Get More Information
              </div>
                	<div class="form-tabs">
      <ul>
                          <li class="selected-tab"><a href=""><%=image_tag "email-and-sms.jpg", :border=>"0px" -%>&nbsp;&nbsp;E-mail and SMS</a></li>
                            <li><a href=""><%=image_tag "get-phone-number.jpg", :border=>"0px" -%>&nbsp;&nbsp;Get Phone Number</a></li>
                        </ul>
                   </div>
              <div class="form">
                <% form_for :query, :url => { :action => "reply" , :id => params[:id], :university => params[:university] } do |query_form| %>
                    <div class="user-type">
                        <input type="radio" name="sex" value="male" /> New User &nbsp;&nbsp;
                        <input type="radio" name="sex" value="female" /> Existing User
                    </div>
                    <div class="message">
                    	Contact this business with your requirements and queries.
                    </div>
                <div class="form-inputs">
                  <%= query_form.text_field  :name ,:size => 28,:class=>"your-name",:value=>"Your Name*",:maxlength=>"40" -%>
               	  <%= query_form.text_field  :email ,:size => 28,:class=>"e-mail-id",:value=>"E-mail ID*",:maxlength=>"40" -%>
                  <%= query_form.text_field  :mobile ,:size => 20,:class=>"mobile-no",:value=>"Mobile No.*",:maxlength=>"10" -%>


                        <div class="query">

                      <%= query_form.text_area  :content , :size => "55x3"  ,:wrap=> "virtual",:value=>"Message*\n\Please provide a detailed response to get a better reply"%>
                        </div>
                </div>
                   <div class="attach">
                        <a href=""><%=image_tag "Attach.jpg", :border=>"0px" -%>Attach a file</a>
                </div>
                    <div class="send-message">
                        <%= image_submit_tag("send-message.jpg")%>
                        </div>
	          </div>
             

              <%end -%>
              <div class="tips">
              Safety Tips
              </div>
          </div>

        </div>
	</div>
	<div class="similar-ads">
    	<div class="similar-ad-header">
			Similar Ads
        </div>
 <% @similarads.each do |similarads|%>
 	<div class="similar-ad-heading">
        	<%=similarads.title%>
        </div>
        <div class="similar-ad-detail">
         	<%=  excerpt(similarads.description, ' ', 60)%>
        </div><%end%>
  </div>
   <div class="separator3">
                	<%=image_tag "line.jpg", :border=>"0px" -%>
   </div>
	<!--<div class="similar-discussion">
    	<div class="similar-discussion-header">
			Similar Discussion
        </div>
    	<div class="similar-discussion-heading">
        	New Batches for CAT
        </div>
        <div class="similar-discussion-detail">
         	Batches staring for CAT, GMAT and other MBA examination from july 2009. Please download the form online.
        </div>
    </div>
   <div class="separator4">
                	<%=image_tag "line.jpg", :border=>"0px" -%>
   </div>
  <div class="similar-article">
    	<div class="similar-article-header">
			Similar Article
        </div>
    	<div class="similar-article-heading">
        	New Batches for CAT
        </div>
        <div class="similar-article-detail">
         	Batches staring for CAT, GMAT and other MBA examination from july 2009. Please download the form online.
        </div>
  </div>
    <div class="tags">
    	<div class="tag-header">
        	Tags        </div>
        <div class="tag-detail">
    		Coaching GRE GMAT TOEFL MBA Entrance Examination    	</div>
     </div>-->
</div>
</body>
</html>


